package com.novatec.util;

import java.io.Serializable;
import java.util.Iterator;
import java.util.List;

import com.novatec.beans.Cajas;
import com.novatec.beans.Productos;

public class HtmlUtil implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public static String armaComboBoxHtml(List<Productos> selecciones,
			String idComboBox) {
		/*
		 * <select id='modeloCajas1' name='modeloCajas1' style='width: 14em'
		 * class='required'><option value=''>Nazca</option></select>
		 */

		StringBuilder concat = new StringBuilder();

		concat.append("<select id='" + idComboBox + "' name='" + idComboBox
				+ "' style='width: 14em' class='required'>");

		Iterator iterador = selecciones.iterator();

		while (iterador.hasNext()) {

			Cajas caja = (Cajas) iterador.next();
			concat.append("<option value='" + caja.getValueCombo() + "'");
			concat.append(caja.getDescModeloCaja());
			concat.append("</option>");
		}

		concat.append("</select>");

		return concat.toString();

	}

	public static String armaInputTex(String idInput, String valor) {

		String input = "<input id='" + idInput + " name='" + idInput
				+ "' type='text' maxlength='10' class='required digits'"
				+ "value='" + valor + "'/>";

		return input;
	}

	public static String armaP(String idP) {

		String p = "<p id='" + idP + "'>";

		return p;

	}

	public static String armaEm() {

		String em = "<em>*</em>";

		return em;
	}

}